package struct;

/**
 * 
 * @author Gabrielle DuBois
 */
public class Money extends DBObject{
    private String year;
    private double pledge;
    private double y2d;
    private String notes;

    /**
     * Constructor
     * @param theYear
     * @param pledged
     * @param year2date
     * @param additionalNotes
     */
    public Money(String theYear, double pledged,
                        double year2date, String additionalNotes){

        super(4,1);
        attributes = new Object[numAttributes];
        attributes[0] = year = theYear;
        attributes[1] = pledge = pledged;
        attributes[2] = y2d = year2date;
        attributes[3] = notes = additionalNotes;

    }//constructor

    /**
     * @see struct.DBObject
     * @return an Object array containing all the attributes that make up a 
     *          money donation in the following order: theYear(String),
     *          pledged(String), year2Date(String), additionalNotes(String)
     */
    public Object[] getAttributes(){
        return attributes;
    }

    /**
     *
     * @return a double containing...
     */
    public double getPledged(){
        return pledge;
    }
    
    /**
     *
     * @return a double containing...
     */
    public double getYear2Date(){
        return y2d;
    }

    /**
     *
     * @return a String containing...
     */
    public String getAdditionalNotes(){
        return notes;
    }

    /**
     * @see struct.DBObject
     * @return A String array with theYear in position 0.
     */
    public String[] getKey(){
        String[] key = new String[numInPrimaryKey];
        key[0] = year;

        return key;
    }//getKey()

    /**
     * 
     * @return a String containing the year
     */
    public String getYear(){
        return year;
    }

}//Money
